package com.hrt.datasender.datadao.model;

import java.util.Date;

import com.btcode.db.fieldtype.FieldType;
import com.btcode.orm.model.BaseModel;
import com.btcode.orm.model.Field;
import com.btcode.orm.model.IField;

public class BdSourceReadRecordModel extends BaseModel {

    private static final long serialVersionUID = 1L;

    private static String tableName = "BD_SOURCE_READ_RECORD";

    public static IField id = new Field(BdSourceReadRecordModel.class, "ID", FieldType.String, true);

    public static IField protocolId = new Field(BdSourceReadRecordModel.class, "PROTOCOL_ID", FieldType.String, false);

    public static IField dataType = new Field(BdSourceReadRecordModel.class, "DATA_TYPE", FieldType.String, false);

    public static IField lastReadTime = new Field(BdSourceReadRecordModel.class, "LAST_READ_TIME", FieldType.DateTime,
            false);

    public static IField lastReadTimeText = new Field(BdSourceReadRecordModel.class, "LAST_READ_TIME_TEXT",
            FieldType.String, false);

    public void setId(String value) {
        setFieldValue(id.getFieldName(), value);
    }

    public String getId() {
        Object value = getFieldValue(BdSourceReadRecordModel.id.getFieldName());
        String result = getValueConver().converToString(value);
        return result;
    }

    public void setProtocolId(String value) {
        setFieldValue(protocolId.getFieldName(), value);
    }

    public String getProtocolId() {
        Object value = getFieldValue(BdSourceReadRecordModel.protocolId.getFieldName());
        String result = getValueConver().converToString(value);
        return result;
    }

    public void setDataType(String value) {
        setFieldValue(dataType.getFieldName(), value);
    }

    public String getDataType() {
        Object value = getFieldValue(BdSourceReadRecordModel.dataType.getFieldName());
        String result = getValueConver().converToString(value);
        return result;
    }

    public void setLastReadTime(Date value) {
        setFieldValue(lastReadTime.getFieldName(), value);
    }

    public Date getLastReadTime() {
        Object value = getFieldValue(BdSourceReadRecordModel.lastReadTime.getFieldName());
        Date result = getValueConver().converToDate(value);
        return result;
    }

    public void setLastReadTimeText(String value) {
        setFieldValue(lastReadTimeText.getFieldName(), value);
    }

    public String getLastReadTimeText() {
        Object value = getFieldValue(BdSourceReadRecordModel.lastReadTimeText.getFieldName());
        String result = getValueConver().converToString(value);
        return result;
    }

    public String getTableName() {
        return tableName;
    }

    public boolean isNeedCache() {
        return false;
    }

}